<template>
	<div>
		<van-form @submit="onSubmit">
					<van-field v-model="password" type="password" name="密码" label="原始密码" placeholder="请输入"/>
					<van-field v-model="xipassword" type="password" name="密码" label="新密码" placeholder="请输入"/>
					<van-field v-model="rePassword" type="password" name="重复密码" label="重复密码" placeholder="请输入" />
					<div style="margin: 16px;">
						<van-button round block type="danger" native-type="submit">确认</van-button>
					</div>
		</van-form>
	</div>

</template>

<script>
	
	export default {
		data() {
			return {
				password: '',
				xipassword:'',
				rePassword: '',
			
			}
		
		},
		methods: {
			queren() {
				if (!this.rePassword || !this.password || !xipassword) {
					this.$toast("密码不为空")
					return
				}
				if(this.password==this.rePassword){
					this.$toast("与原始密码一样")
					return
				}
				register({
					password: this.xiPassword
				}).then(res => {
					if (res.status == 200) {
						this.$toast.success("注册成功")
						this.$router.push("/login")
					}
				})

			},
		},
	}
</script>

<style scoped>
	
</style>
